﻿package mortal.game.resource.tableConfig
{
    import Message.DB.Tables.*;
    import Message.Game.*;
    import com.gengine.resource.*;
    import flash.utils.*;
    import mortal.game.view.common.*;

    public class PetBreakConfig extends Object
    {
        private var _dic:Dictionary;
        private static var _instance:PetBreakConfig;

        public function PetBreakConfig()
        {
            this.init();
            return;
        }// end function

        private function init() : void
        {
            var _loc_2:Object = null;
            var _loc_3:TPetBreakConfig = null;
            this._dic = new Dictionary();
            var _loc_1:* = ConfigManager.instance.getJSONByFileName("t_pet_break_config.json");
            for each (_loc_2 in _loc_1)
            {
                
                _loc_3 = new TPetBreakConfig();
                ClassTypesUtil.copyValue(_loc_3, _loc_2);
                this._dic[_loc_3.floor + "_" + _loc_3.pass] = _loc_3;
            }
            return;
        }// end function

        public function getItem(param1:int, param2:int) : TPetBreakConfig
        {
            return this._dic[param1 + "_" + param2] as TPetBreakConfig;
        }// end function

        public function getAllInCode(param1:int) : Array
        {
            var _loc_3:TPetBreakConfig = null;
            var _loc_2:Array = [];
            for each (_loc_3 in this._dic)
            {
                
                if (_loc_3.isBig == EPetBreakType._EBreakBigPass && (_loc_3.itemIndex1 == param1 || _loc_3.itemIndex2 == param1 || _loc_3.itemIndex3 == param1 || _loc_3.itemIndex4 == param1))
                {
                    _loc_2.push(_loc_3);
                }
            }
            return _loc_2;
        }// end function

        public static function get instance() : PetBreakConfig
        {
            if (!_instance)
            {
                _instance = new PetBreakConfig;
            }
            return _instance;
        }// end function

    }
}
